//
//  WBDemoViewController.swift
//  微博
//
//  Created by dong on 2017/11/17.
//  Copyright © 2017年 dong. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        //设置标题
        title = "第\(navigationController?.childViewControllers.count ?? 0)个"
    }
    //继续push一个新的控制器
    func showNext(){
        
        let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }

}

extension WBDemoViewController{
    
    
     //重写父类方法
    override func setupTableView(){
        
        super.setupTableView()
        
          navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
    

}
